<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>位置详情</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <style>
        html,
        body {
            font-size: 14px;
            height: 100%;
            background-color: #f2f2f2;
        }

        header {
            position: fixed;
            top: 0;
            width: 100%;
            height: 75px;
            text-align: left;
            background-color: #fff;
            border-bottom: 1px solid #f2f2f2;
        }

        header .back {
            position: relative;
            margin-top: 38px;
            width: 100%;
            height: 1.5rem;
            text-align: center;
        }

        .back img {
            position: absolute;
            left: 1rem;
            width: 1.5rem;
            height: 1.5rem;
            vertical-align: middle;
        }
    </style>
</head>

<body>
    <header>
        <div class="back">
            <img src="../image/icon/back.png" alt="" onclick="api.closeWin()">
            <span>位置详情</span>
        </div>
    </header>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
    apiready = function() {
        load();
    };

    function load() {
        var map = api.require('bMap');
        map.setMapAttr({
            type: 'standard'
        });
        map.open({
            rect: {
                x: 0,
                y: 75,
            },
            center: {
                lon: api.pageParam.lon,
                lat: api.pageParam.lat
            },
            zoomLevel: 16,
            showUserLocation: true,
            fixedOn: api.frameName,
            fixed: true
        }, function(ret) {
            if (ret.status) {
                map.addAnnotations({
                    annotations: [{
                        id: "1",
                        lon: api.pageParam.lon,
                        lat: api.pageParam.lat,
                        size: 20
                    }],
                    icon: '../image/icon/location.png',
                    draggable: true
                }, function(ret) {});
            }
        });
    }
</script>

</html>
